package com.dddd.blog.blogcommon.utils;


import org.dozer.DozerBeanMapper;

/**
 * 对象转化工具类(VO<=>DTO DTO<=>DO)
 * @author 喵星球的大橘
 */
public class ObjectInvertUtils<T> {

    private static DozerBeanMapper mapper = new DozerBeanMapper();

    /**
     * @param from 源对象
     * @param clazz 目标对象
     * @return
     */
    public static <T> T invert(Object from, Class<T> clazz){

        try{
            T target = mapper.map(from, clazz);
            return target;
        }catch(Exception e){

        }
        return null;
    }

}
